import 'package:flutter/material.dart';

Widget listitembuilder(context, index) {
  return Container(
    padding: const EdgeInsets.all(8),
    child: Row(
      children: [
        Image.network(
          'https://yanxuan-item.nosdn.127.net/e529b6ab111ade9da9314867f98d360f.png',
          width: 90,
        ),
        const Expanded(
            child: Text(
          '海尔（Haier）波轮洗衣机全自动家用 10公斤大容量 直驱变频 一级能效 高效精华洗 以旧换新EB100B37Mate5',
          maxLines: 2,
          overflow: TextOverflow.ellipsis,
        )),
        Container(
          margin: const EdgeInsets.only(left: 10),
          child: const Icon(Icons.timer, size: 30),
        )
      ],
    ),
  );
}

class MyApp12 extends StatelessWidget {
  const MyApp12({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        home: Scaffold(
            appBar: AppBar(
              title: const Text('ListView'),
              backgroundColor: Colors.black26,
              centerTitle: true,
            ),
            body: Container(
              padding:
                  const EdgeInsets.only(left: 14, right: 12, top: 5, bottom: 5),
              child: ListView.separated(
                  itemBuilder: listitembuilder,
                  itemCount: 10,
                  separatorBuilder: (context, index) {
                    return Container(
                      height: 2,
                      color: Colors.greenAccent,
                      margin: const EdgeInsets.only(left:8,right:8),
                    );
                  }),
            )));
  }
}
